SPB Git

Repository Public

page.tsx 657 B 16 lines tsx

1import { notFound, permanentRedirect } from "next/navigation";2import { getRedirects } from "@/lib/content";34export const metadata = { title: "Page introuvable", robots: { index: false, follow: false } };56/**7 * Every address that no other route answers. A path of the editorial redirect list gets a permanent8 * redirect; anything else is a real 404, rendered inside the public layout.9 */10export default async function Unmatched({ params }: { params: Promise<{ rest: string[] }> }) {11  const path = `/${(await params).rest.join("/")}`;12  const to = (await getRedirects()).paths.get(path);13  if (to && to !== path) permanentRedirect(to);14  notFound();15}16
Files main
Menu

Theme